// 客户，供应商
const {DataTypes, db } = require("../db");
db.define('contact', {
id: {type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true,comment:'表自增ID'},
tenantId:{type: DataTypes.INTEGER,allowNull:false,comment:'租户'}, 
areaId:{type: DataTypes.INTEGER,defaultValue:0,comment:'配送区域ID'}, 
salesId:{type: DataTypes.INTEGER,comment:'业务员'}, 
code:{type: DataTypes.STRING(20),comment:'客户编号'}, 
name:{type: DataTypes.STRING(150),allowNull:false,comment:'客户名称'}, 
pinYin:{type: DataTypes.STRING(50),comment:'拼音首字母'}, 
categoryId:{type: DataTypes.INTEGER,comment:'客户类别'}, 
linkName:{type: DataTypes.STRING(50),comment:'联系人'}, 
linkMobile:{type: DataTypes.STRING(50),comment:'联系电话'}, 
address:{type: DataTypes.STRING(255),comment:'联系地址'}, 
payType:{type: DataTypes.STRING(22),comment:'结算周期 现结|月结|滚单'}, 
amount:{type: DataTypes.DECIMAL(18, 2),comment:'期初应付款'}, 
latitude:{type: DataTypes.STRING(255),defaultValue:(''),comment:'纬度'}, 
longitude:{type: DataTypes.STRING(255),defaultValue:(''),comment:'经度'}, 
isCustomer:{type: DataTypes.INTEGER,defaultValue:1,comment:'可销货'}, 
isProvider:{type: DataTypes.INTEGER,defaultValue:0,comment:'可供货'}, 
lastBfDay:{type: DataTypes.STRING(10),comment:'最后一次拜访日期'}, 
remark:{type: DataTypes.STRING(250),comment:'备注'}, 
periodMoney:{type: DataTypes.DECIMAL(18, 2),comment:'期初预付款'}, 
beginDate:{type: DataTypes.STRING(10),comment:'余额日期'}, 
imgUrl:{type: DataTypes.STRING(255),comment:'头像地址'}, 
distance:{type: DataTypes.DECIMAL(20, 2),defaultValue:0,comment:'终端到仓库间的距离'}, 
addressLocation:{type: DataTypes.STRING(255),defaultValue:(''),comment:'定位取回的地址'}, 
shopImages:{type: DataTypes.STRING(2000),defaultValue:(''),comment:'店铺展示图片'}, 
cbyName:{type: DataTypes.STRING(255),comment:''}, 
userpwd:{type: DataTypes.STRING(255),comment:''}, 
token:{type: DataTypes.STRING(255)},
errCount:{type: DataTypes.INTEGER,defaultValue:0,comment:''}, 
bak2:{type: DataTypes.STRING(255),comment:''}, 
bak3:{type: DataTypes.STRING(255),comment:''}, 
quick:{type: DataTypes.STRING(255),comment:'快速搜索列'}, 
disabled:{type: DataTypes.TINYINT,defaultValue:0,comment:'0启用   1禁用'}, 
isDel:{type: DataTypes.INTEGER,defaultValue:0,comment:''}, 
taxRate:{type: DataTypes.DECIMAL(18, 2),comment:'税率'}, 
difMoney:{type: DataTypes.DECIMAL(18, 2),comment:'初期往来余额'}, 
categoryName:{type: DataTypes.STRING(50),comment:'分类名称'}, 
linkPhone:{type: DataTypes.STRING(50),comment:'联系电话'}, 
cby:{type: DataTypes.INTEGER,comment:''}, 
ctime:{type: DataTypes.STRING(20),comment:''}, 
uby:{type: DataTypes.INTEGER,comment:''}, 
utime:{type: DataTypes.STRING(20),comment:''}, 
dby:{type: DataTypes.INTEGER,comment:''}, 
dtime:{type: DataTypes.STRING(20),comment:''}, 
printBar:{type: DataTypes.INTEGER,defaultValue:0,comment:'打印商品条码'}, 
canLogin:{type: DataTypes.INTEGER,defaultValue:0,comment:''}, 

}, {
    tableName: 'contact',
    timestamps: false,
    comment: '客户，供应商',
    
});